package com.wpw.web.design.single;


import java.lang.reflect.Constructor;

/**
 * @Description:
 * @ClassName: SingleTest
 * @CreateDate: 2020-05-04 11:06
 * @author: wupengwei
 */
public class SingleTest {

    public static void main(String[] args) throws Exception {
        Singleton singleton = Singleton.getInstance();
        Constructor<Singleton> constructor = Singleton.class.getDeclaredConstructor(Singleton.class);
        constructor.setAccessible(true);
        Singleton newSingleton = constructor.newInstance();
        System.out.println(singleton == newSingleton);
    }
}